//
//  RWFriendTrendViewController.m
//  baisibudejie
//
//  Created by renwei on 16/9/13.
//  Copyright © 2016年 renwei. All rights reserved.
//

#import "RWFriendTrendViewController.h"

#import "XMGLoginRegisterViewController.h"

@interface RWFriendTrendViewController()

@end

@implementation RWFriendTrendViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    // 设置导航栏
    [self setupNavBar];
    // 创建主视图
    [self createMainView];
}

#pragma mark - 设置主界面
- (void)createMainView {
    
    UIButton *loginButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [loginButton setBackgroundColor:[UIColor redColor]];
    [loginButton setTitle:@"登录" forState:UIControlStateNormal];
    [loginButton addTarget:self action:@selector(clickLogin) forControlEvents:UIControlEventTouchUpInside];
    
    [self.view addSubview:loginButton];
    
    [loginButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.centerY.equalTo(self.view);
        make.height.equalTo(@40);
        make.width.equalTo(@300);
    }];
}


#pragma mark - 监听方法
// 推荐关注
- (void)friendsRecomment {
    
}

- (void)clickLogin {
    
    XMGLoginRegisterViewController *loginRegisterVC = [[XMGLoginRegisterViewController alloc] init];
    [self presentViewController:loginRegisterVC animated:YES completion:nil];
}

#pragma mark - 设置导航条
- (void)setupNavBar {
    
    // 左边按钮
    // 把UIButton包装成UIBarButtonItem.就导致按钮点击区域扩大
    self.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithimage:[UIImage imageNamed:@"friendsRecommentIcon"] highImage:[UIImage imageNamed:@"friendsRecommentIcon-click"] target:self action:@selector(friendsRecomment)];
    
    // titleView
    self.navigationItem.title = @"我的关注";
    
}

@end
